LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)


#LOCAL_MODULE
#    This is the name of your module. It must be unique among all
#    module names, and shall not contain any space. You MUST define
#    it before including any $(BUILD_XXXX) script.
#
#    By default, the module name determines the name of generated files,
#    e.g. lib<foo>.so for a shared library module named <foo>. However
#    you should only refer to other modules with their 'normal'
#    name (e.g. <foo>) in your NDK build files (either Android.mk
#    or Application.mk)
#
#    You can override this default with LOCAL_MODULE_FILENAME (see below)
#
#LOCAL_MODULE_FILENAME
#    This variable is optional, and allows you to redefine the name of
#    generated files. By default, module <foo> will always generate a
#    static library named lib<foo>.a or a shared library named lib<foo>.so,
#    which are standard Unix conventions.
#
#    You can override this by defining LOCAL_MODULE_FILENAME, For example:
#
#        LOCAL_MODULE := foo-version-1
#        LOCAL_MODULE_FILENAME := libfoo
#
#    NOTE: You should not put a path or file extension in your
#    LOCAL_MODULE_FILENAME, these will be handled automatically by the
#    build system.
LOCAL_MODULE                  := DeflatingDecompressor-v3

#This is a list of source files that will be built for your module.
#    Only list the files that will be passed to a compiler, since the
#    build system automatically computes dependencies for you.
#
#    Note that source files names are all relative to LOCAL_PATH and
#    you can use path components, e.g.:
#
#      LOCAL_SRC_FILES := foo.c \
#                         toto/bar.c
#
#    NOTE: Always use Unix-style forward slashes (/) in build files.
#          Windows-style back-slashes will not be handled properly.

LOCAL_SRC_FILES               := DeflatingDecompressor/DeflatingDecompressor.cpp

#LOCAL_LDLIBS
#    The list of additional linker flags to be used when building your
#    module. This is useful to pass the name of specific system libraries
#    with the "-l" prefix. For example, the following will tell the linker
#    to generate a module that links to /system/lib/libz.so at load time:
#
#      LOCAL_LDLIBS := -lz
#
#    See docs/STABLE-APIS.html for the list of exposed system libraries you
#    can linked against with this NDK release.
LOCAL_LDLIBS                  := -lz

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE                  := LineBreak-v2
LOCAL_SRC_FILES               := \
	LineBreak/LineBreaker.cpp \
	LineBreak/liblinebreak-2.0/linebreak.c \
	LineBreak/liblinebreak-2.0/linebreakdata.c \
	LineBreak/liblinebreak-2.0/linebreakdef.c

include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

EXPAT_DIR                     := expat-2.0.1

LOCAL_MODULE                  := expat
LOCAL_SRC_FILES               := \
	$(EXPAT_DIR)/lib/xmlparse.c \
	$(EXPAT_DIR)/lib/xmlrole.c \
	$(EXPAT_DIR)/lib/xmltok.c

#LOCAL_CFLAGS
#    An optional set of compiler flags that will be passed when building
#    C *and* C++ source files.
#
#    This can be useful to specify additional macro definitions or
#    compile options.
#
#    IMPORTANT: Try not to change the optimization/debugging level in
#               your Android.mk, this can be handled automatically for
#               you by specifying the appropriate information in
#               your Application.mk, and will let the NDK generate
#               useful data files used during debugging.
#
#    NOTE: In android-ndk-1.5_r1, the corresponding flags only applied
#          to C source files, not C++ ones. This has been corrected to
#          match the full Android build system behaviour. (You can use
#          LOCAL_CPPFLAGS to specify flags for C++ sources only now).
#
#    It is possible to specify additional include paths with
#    LOCAL_CFLAGS += -I<path>, however, it is better to use LOCAL_C_INCLUDES
#    for this, since the paths will then also be used during native
#    debugging with ndk-gdb.	
LOCAL_CFLAGS                  := -DHAVE_EXPAT_CONFIG_H

#LOCAL_C_INCLUDES
#    An optional list of paths, relative to the NDK *root* directory,
#    which will be appended to the include search path when compiling
#    all sources (C, C++ and Assembly). For example:
#
#        LOCAL_C_INCLUDES := sources/foo
#
#    Or even:
#
#        LOCAL_C_INCLUDES := $(LOCAL_PATH)/../foo
#
#    These are placed before any corresponding inclusion flag in
#    LOCAL_CFLAGS / LOCAL_CPPFLAGS
#
#    The LOCAL_C_INCLUDES path are also used automatically when
#    launching native debugging with ndk-gdb.
LOCAL_C_INCLUDES              := $(LOCAL_PATH)/$(EXPAT_DIR)

#LOCAL_EXPORT_C_INCLUDES
#    Same as LOCAL_EXPORT_CFLAGS, but for C include paths.
#    This can be useful if 'bar.c' wants to include headers
#    that are provided by module 'foo'.
LOCAL_EXPORT_C_INCLUDES       := $(LOCAL_PATH)/$(EXPAT_DIR)/lib

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE                  := NativeFormats-v2
LOCAL_CFLAGS                  := -Wall
LOCAL_LDLIBS                  := -lz -llog

#LOCAL_STATIC_LIBRARIES
#    The list of static libraries modules (built with BUILD_STATIC_LIBRARY)
#    that should be linked to this module. This only makes sense in
#    shared library modules.
LOCAL_STATIC_LIBRARIES        := expat

LOCAL_SRC_FILES               := \
	NativeFormats/main.cpp \
	NativeFormats/JavaNativeFormatPlugin.cpp \
	NativeFormats/JavaPluginCollection.cpp \
	NativeFormats/util/AndroidUtil.cpp \
	NativeFormats/util/JniEnvelope.cpp \
	NativeFormats/zlibrary/core/src/constants/ZLXMLNamespace.cpp \
	NativeFormats/zlibrary/core/src/encoding/DummyEncodingConverter.cpp \
	NativeFormats/zlibrary/core/src/encoding/Utf16EncodingConverters.cpp \
	NativeFormats/zlibrary/core/src/encoding/JavaEncodingConverter.cpp \
	NativeFormats/zlibrary/core/src/encoding/ZLEncodingCollection.cpp \
	NativeFormats/zlibrary/core/src/encoding/ZLEncodingConverter.cpp \
	NativeFormats/zlibrary/core/src/filesystem/ZLDir.cpp \
	NativeFormats/zlibrary/core/src/filesystem/ZLFSManager.cpp \
	NativeFormats/zlibrary/core/src/filesystem/ZLFile.cpp \
	NativeFormats/zlibrary/core/src/filesystem/ZLInputStreamDecorator.cpp \
	NativeFormats/zlibrary/core/src/filesystem/zip/ZLGzipInputStream.cpp \
	NativeFormats/zlibrary/core/src/filesystem/zip/ZLZDecompressor.cpp \
	NativeFormats/zlibrary/core/src/filesystem/zip/ZLZipDir.cpp \
	NativeFormats/zlibrary/core/src/filesystem/zip/ZLZipEntryCache.cpp \
	NativeFormats/zlibrary/core/src/filesystem/zip/ZLZipHeader.cpp \
	NativeFormats/zlibrary/core/src/filesystem/zip/ZLZipInputStream.cpp \
	NativeFormats/zlibrary/core/src/language/ZLCharSequence.cpp \
	NativeFormats/zlibrary/core/src/language/ZLLanguageDetector.cpp \
	NativeFormats/zlibrary/core/src/language/ZLLanguageList.cpp \
	NativeFormats/zlibrary/core/src/language/ZLLanguageMatcher.cpp \
	NativeFormats/zlibrary/core/src/language/ZLStatistics.cpp \
	NativeFormats/zlibrary/core/src/language/ZLStatisticsGenerator.cpp \
	NativeFormats/zlibrary/core/src/language/ZLStatisticsItem.cpp \
	NativeFormats/zlibrary/core/src/language/ZLStatisticsXMLReader.cpp \
	NativeFormats/zlibrary/core/src/library/ZLibrary.cpp \
	NativeFormats/zlibrary/core/src/logger/ZLLogger.cpp \
	NativeFormats/zlibrary/core/src/util/ZLFileUtil.cpp \
	NativeFormats/zlibrary/core/src/util/ZLStringUtil.cpp \
	NativeFormats/zlibrary/core/src/util/ZLUnicodeUtil.cpp \
	NativeFormats/zlibrary/core/src/xml/ZLAsynchronousInputStream.cpp \
	NativeFormats/zlibrary/core/src/xml/ZLPlainAsynchronousInputStream.cpp \
	NativeFormats/zlibrary/core/src/xml/ZLXMLReader.cpp \
	NativeFormats/zlibrary/core/src/xml/expat/ZLXMLReaderInternal.cpp \
	NativeFormats/zlibrary/core/src/unix/filesystem/ZLUnixFSDir.cpp \
	NativeFormats/zlibrary/core/src/unix/filesystem/ZLUnixFSManager.cpp \
	NativeFormats/zlibrary/core/src/unix/filesystem/ZLUnixFileInputStream.cpp \
	NativeFormats/zlibrary/core/src/unix/filesystem/ZLUnixFileOutputStream.cpp \
	NativeFormats/zlibrary/core/src/unix/library/ZLUnixLibrary.cpp \
	NativeFormats/zlibrary/text/src/model/ZLCachedMemoryAllocator.cpp \
	NativeFormats/zlibrary/text/src/model/ZLTextModel.cpp \
	NativeFormats/zlibrary/text/src/model/ZLTextParagraph.cpp \
	NativeFormats/zlibrary/ui/src/android/filesystem/JavaFSDir.cpp \
	NativeFormats/zlibrary/ui/src/android/filesystem/JavaInputStream.cpp \
	NativeFormats/zlibrary/ui/src/android/filesystem/ZLAndroidFSManager.cpp \
	NativeFormats/zlibrary/ui/src/android/library/ZLAndroidLibraryImplementation.cpp \
	NativeFormats/fbreader/src/bookmodel/BookModel.cpp \
	NativeFormats/fbreader/src/bookmodel/BookReader.cpp \
	NativeFormats/fbreader/src/formats/EncodedTextReader.cpp \
	NativeFormats/fbreader/src/formats/FormatPlugin.cpp \
	NativeFormats/fbreader/src/formats/PluginCollection.cpp \
	NativeFormats/fbreader/src/formats/fb2/FB2BookReader.cpp \
	NativeFormats/fbreader/src/formats/fb2/FB2CoverReader.cpp \
	NativeFormats/fbreader/src/formats/fb2/FB2MetaInfoReader.cpp \
	NativeFormats/fbreader/src/formats/fb2/FB2Plugin.cpp \
	NativeFormats/fbreader/src/formats/fb2/FB2Reader.cpp \
	NativeFormats/fbreader/src/formats/fb2/FB2TagManager.cpp \
	NativeFormats/fbreader/src/formats/css/StyleSheetParser.cpp \
	NativeFormats/fbreader/src/formats/css/StyleSheetTable.cpp \
	NativeFormats/fbreader/src/formats/html/HtmlBookReader.cpp \
	NativeFormats/fbreader/src/formats/html/HtmlDescriptionReader.cpp \
	NativeFormats/fbreader/src/formats/html/HtmlEntityCollection.cpp \
	NativeFormats/fbreader/src/formats/html/HtmlPlugin.cpp \
	NativeFormats/fbreader/src/formats/html/HtmlReader.cpp \
	NativeFormats/fbreader/src/formats/html/HtmlReaderStream.cpp \
	NativeFormats/fbreader/src/formats/oeb/NCXReader.cpp \
	NativeFormats/fbreader/src/formats/oeb/OEBBookReader.cpp \
	NativeFormats/fbreader/src/formats/oeb/OEBCoverReader.cpp \
	NativeFormats/fbreader/src/formats/oeb/OEBMetaInfoReader.cpp \
	NativeFormats/fbreader/src/formats/oeb/OEBPlugin.cpp \
	NativeFormats/fbreader/src/formats/oeb/OEBTextStream.cpp \
	NativeFormats/fbreader/src/formats/oeb/XHTMLImageFinder.cpp \
	NativeFormats/fbreader/src/formats/rtf/RtfBookReader.cpp \
	NativeFormats/fbreader/src/formats/rtf/RtfDescriptionReader.cpp \
	NativeFormats/fbreader/src/formats/rtf/RtfPlugin.cpp \
	NativeFormats/fbreader/src/formats/rtf/RtfReader.cpp \
	NativeFormats/fbreader/src/formats/rtf/RtfReaderStream.cpp \
	NativeFormats/fbreader/src/formats/txt/PlainTextFormat.cpp \
	NativeFormats/fbreader/src/formats/txt/TxtBookReader.cpp \
	NativeFormats/fbreader/src/formats/txt/TxtPlugin.cpp \
	NativeFormats/fbreader/src/formats/txt/TxtReader.cpp \
	NativeFormats/fbreader/src/formats/util/EntityFilesCollector.cpp \
	NativeFormats/fbreader/src/formats/util/MergedStream.cpp \
	NativeFormats/fbreader/src/formats/util/MiscUtil.cpp \
	NativeFormats/fbreader/src/formats/util/XMLTextStream.cpp \
	NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp \
	NativeFormats/fbreader/src/library/Author.cpp \
	NativeFormats/fbreader/src/library/Book.cpp \
	NativeFormats/fbreader/src/library/Comparators.cpp \
	NativeFormats/fbreader/src/library/Library.cpp \
	NativeFormats/fbreader/src/library/Tag.cpp

LOCAL_C_INCLUDES              := \
	$(LOCAL_PATH)/NativeFormats/util \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/constants \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/encoding \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/filesystem \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/image \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/language \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/library \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/logger \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/util \
	$(LOCAL_PATH)/NativeFormats/zlibrary/core/src/xml \
	$(LOCAL_PATH)/NativeFormats/zlibrary/text/src/model

include $(BUILD_SHARED_LIBRARY)
